var app = getApp()

Page({
  data: {
    navLeftItems: [],
    navRightItems: [],
    curNav: 1,
    curIndex: 0
  },

  onLoad: function () {
    var thiz = this
    var PageInterface = app.globalData.domain + app.globalData.PageInterface
    var domain = app.globalData.domain

    thiz.setData({
      hiddenLoading: false
    })

    wx.request({
      url: PageInterface,
      method: 'POST',
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      data: {
        format_type: 'json',
        api_cate: 'Goods',
        api: 4014
      },
      success: function (res) {
        thiz.setData({
          navLeftItems: res.data.data,
          navRightItems: res.data.data,
          hiddenLoading: true,
          domain: domain
        })
      }
    });
  },

  switchRightTab: function (e) {
    let id = e.target.dataset.id,
      index = parseInt(e.target.dataset.index);
    this.setData({
      curNav: id,
      curIndex: index
    })
  }

})